class UserRecord {
  final String? uid;
  final String? addFollowCount;
  final String? noreplyCount;
  final String? agreeCollectionCount;

  UserRecord({
    this.uid,
    this.addFollowCount,
    this.noreplyCount,
    this.agreeCollectionCount,
  });

  // 从Map<String, dynamic>反序列化为UserRecord实例
  factory UserRecord.fromJson(Map<String, dynamic> json) {
    return UserRecord(
      uid: json['uid'],
      addFollowCount: json['addFollowCount'],
      noreplyCount: json['noreplyCount'],
      agreeCollectionCount: json['agreeCollectionCount'],
    );
  }

  // 将UserRecord实例序列化为Map<String, dynamic>
  Map<String, dynamic> toJson() {
    return {
      'uid': uid,
      'addFollowCount': addFollowCount,
      'noreplyCount': noreplyCount,
      'agreeCollectionCount': agreeCollectionCount,
    };
  }
}

class UserRecordList {
  final List<UserRecord> records;

  UserRecordList({required this.records});

  // 从List<dynamic>反序列化为UserRecordList实例
  factory UserRecordList.fromJson(List<dynamic> jsonList) {
    List<UserRecord> records = [];
    for (var json in jsonList) {
      records.add(UserRecord.fromJson(json));
    }
    return UserRecordList(records: records);
  }

  // 将UserRecordList实例序列化为List<Map<String, dynamic>>
  List<Map<String, dynamic>> toJson() {
    return records.map((record) => record.toJson()).toList();
  }
}